package com.xbongbong.sys.model.impl;

import com.xbongbong.sys.domain.dao.AlipayNotifyDao;
import com.xbongbong.sys.domain.entity.AlipayNotifyEntity;
import com.xbongbong.sys.model.AlipayNotifyModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @description: 支付通知
 * @Author: hongxiao
 * @date: 2019-09-16 15:45
 * @since v1.0
 */
@Service("AlipayNotifyModel")
public class AlipayNotifyModelImpl implements AlipayNotifyModel {
    @Resource
    private AlipayNotifyDao alipayNotifyDao;

    @Override
    public Integer insert(AlipayNotifyEntity entity) {
        return alipayNotifyDao.insert(entity);
    }

    @Override
    public Integer update(AlipayNotifyEntity entity) {
        return alipayNotifyDao.update(entity);
    }

    @Override
    public Integer save(AlipayNotifyEntity entity) {
        if(entity.getId() == null || entity.getId().equals(0L)) {
            return insert(entity);
        }
        return update(entity);
    }

    @Override
    public Integer deleteByKey(Long key) {
        return alipayNotifyDao.deleteByKey(key);
    }

    @Override
    public AlipayNotifyEntity getByKey(Long key) {
        return alipayNotifyDao.getByKey(key);
    }

    @Override
    public List<AlipayNotifyEntity> findEntitys(Map<String ,Object> param) {
        return alipayNotifyDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String ,Object>  param) {
        return alipayNotifyDao.getEntitysCount(param);
    }
}
